'''
Created on 23/05/2014

@author: dingliangl
'''

from cj_lib import *
from properties import *

import math
import fractions


#curr_file_name = '-large-practice'
#curr_file_name = '-small-practice'
curr_file_name = 'test'

# map(int, input_lines.pop(0).split(' '))

def input_dividing_func(input_lines):
    total_case = int(input_lines.pop(0))
    case_inputs = []
    for i in range(total_case):
        case_inputs.append(map(int, input_lines.pop(0).split(' ')))
    return case_inputs
    
def process_func(func_input):
    N, P = func_input
    return 0

run_proc(process_func, input_dividing_func, curr_working_folder, curr_file_name)


print int2bin(10, 4)
print bin2int('11110')
print bin2int(list('11110'))
print bin2int([1,1,1,1,0])
